﻿/**************************************************************
 * Project     : Titan Framework
 * Copyright (C) 2011 Microsoft Corp.
 * Author      : Julian Hu
 * Mail        : junhu@microsoft.com
 * Create Date : 2011-05-09
 * Summary     :   
 * 
 * 
 * Modified By : 
 * Date        : 
 * Mail        : 
 * Comment     :   
 * *************************************************************/

using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Titan.Common
{
    /// <summary>
    /// 对应数据库中的主键
    /// </summary>
    public class PrimaryKey : Attribute
    {
    }

    /// <summary>
    /// 自增长ID
    /// </summary>
    public class Identity : Attribute
    {
    }

    /// <summary>
    /// 对应数据库中的外键
    /// </summary>
    public class ForeignKey : Attribute
    {
    }

    public class DisableFilter : Attribute
    { }

    public class UniqueCheck : Attribute
    { }

    public class ParentFiled : Attribute
    { }

    /// <summary>
    /// 对应数据库中表的名称
    /// </summary>
    public class TableName : Attribute
    {
        string name = string.Empty;

        public TableName(string tableName)
        {
            name = tableName;
        }

        public string Name
        {
            get { return name; }
        }

        protected void ResetName(string name)
        {
            this.name = name;
        }
    }

    /// <summary>
    /// 外键依赖表
    /// </summary>
    public class ReferenceTableName : Attribute
    {
        private string _name = string.Empty;

        public ReferenceTableName(string tableName)
        {
            this._name = tableName;
        }

        public string Name
        {
            get
            {
                return this._name;
            }
        }
    }

    public class Length : Attribute
    {
        int fieldLenth = 0;
        public Length(int length)
        {
            fieldLenth = length;
        }

        public int FieldLength
        {
            get { return fieldLenth; }
        }
    }
}
